package cn.edu.zut.score.core.convert;

import cn.edu.zut.score.core.dto.response.GradeResponse;
import cn.edu.zut.score.core.entity.Grade;
import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zby
 * @date 2021/08/07
 */
@ApiModel("分数相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface GradeConvert {

    GradeConvert INSTANCE = Mappers.getMapper(GradeConvert.class);

    List<GradeResponse> grades2Responses(List<Grade> grades);
}
